End a chat session under the `user_end` reason.
Runs the same lifecycle pipeline a voice call’s completion does: post-call analysis, completion webhook, Postgres CallResult, Elasticsearch index, audit event. Idempotent — calling on an already-final session returns the current snapshot without re-running the pipeline.
Path Parameters
Body
Request body for POST /api/v1/chats/{id}/end. Always finalises the session under
the user_end reason (the TTL sweeper uses ttl, the agent uses
agent_finish) and runs the same !:TextChatCallLifecycle.FinishAsync
pipeline a voice call uses — completion webhook + post-call analysis + persistence.
Optional operator-supplied free-form note appended to the activity log for this finalisation. Not used by the pipeline; purely audit metadata.
Response
Session ended (or was already final).
Public projection of a chat session — what callers see via GET /api/v1/chats/{id}
and the list endpoint. Deliberately omits the orchestration State blob, the
ExternalIdHash, and the worker hot-flags; those are server-internal.
Session identifier.
Agent driving this session. Frozen at open.
Channel name (web, twilio_sms, …).
Full conversation transcript so far, in send order.
Session creation timestamp (UTC).
Most recent activity timestamp (inbound, outbound or assistant turn).
Inactivity timeout in seconds; null when no TTL applies.
True once the session has terminated.
Status mirror of DashaAI.BlackBox.AgentAPI.TextChat.Dtos.Chats.ChatSessionDto.IsFinal for list-endpoint filtering (active /
final).
Reason for finalisation (ttl, user_end, agent_finish, …).